package com.weixin.engine.event;

import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * TODO 功能描述
 *
 * @author wangchunhui
 * @date 2023/12/12 10:21
 */
@Component
public class PaymentService {

    @Resource
    private ApplicationContext applicationContext;

    public void doService() {

        System.out.println(this.getClass().getName() + " 准备做出一些改变，这些改变将会影响到其他的地方");

        PaymentInfo paymentInfo = new PaymentInfo(123, "无所谓什么状态了,就是个测试而已");

        MySpringApplicationEventForPay event = new MySpringApplicationEventForPay(paymentInfo);
        // 发布事件
        applicationContext.publishEvent(event);

    }

}